-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add Otterscan (ots_) Provider #5032
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
k-thornton
wants to merge
8
commits into
ethers-io:main
Choose a base branch
from
cowrie-dev:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…scan) methods If your node supports the ots_ namespace, you'll have access to 11 new RPC methods: ots_getApiLevel, ots_hasCode, ots_getInternalOperations, ots_getTransactionError, ots_traceTransaction, ots_getBlockDetails, ots_getBlockTransactions, ots_searchTransactionsBefore/After, ots_getTransactionBySenderAndNonce, ots_getContractCreator - Convenience methods: getTransactionRevertReason() (decodes revert data), ensureOts() (making sure you're running an ots_ compatible node), iterateAddressHistory() (async iterator for pagination) - Full TypeScript support: Proper interfaces for all return types (OtsInternalOp, OtsBlockDetails, etc.) - 16 new unit tests covering all functionality
Author
|
Hey sorry this kinda just came out of nowhere. I made this for a private project and figured it would be useful to contribute back! |
Member
|
I like it. I definitely think it’s useful, but might make a good candidate for the ethers-ext extension packages. I’ll look at it t hi s weekend. :) |
…response types. Adding missing getBlockDetailsByHash() method. Added real ots_ raw data to the unit tests to make them more accurate. Added the "reasoning" from the otterscan docs to the JSDoc comments.
Actually utilizing the OtsAddressTransactionsPage type for searchTransactionsBefore/After Addressing 2 notes from Otterscan maintainer: the page numbers will be ascending/descending based on search direction, and updating the docstrings to note the pageSize limit is a soft limit
…ion and pageSize since it's a helper method anyway.
…anteed from the API
…sponses in descending block order, and it was written assuming ascending
…oving +1 from the endBlock pagination logic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding a new subclass of JsonRpcProvider supporting erigon's ots_ (Otterscan) methods. The ots_ namespace provides some very helpful methods, most importantly being able to quickly fetch a list of all transactions belonging to a given address.
If your node supports the ots_ namespace, this provider will give you access to 11 new RPC methods: ots_getApiLevel, ots_hasCode, ots_getInternalOperations, ots_getTransactionError, ots_traceTransaction, ots_getBlockDetails, ots_getBlockTransactions, ots_searchTransactionsBefore/After, ots_getTransactionBySenderAndNonce, ots_getContractCreator